package com.dianping.cat.home.dal.report;

import org.unidal.dal.jdbc.DataField;
import org.unidal.dal.jdbc.QueryDef;
import org.unidal.dal.jdbc.QueryType;
import org.unidal.dal.jdbc.Readset;
import org.unidal.dal.jdbc.Updateset;
import org.unidal.dal.jdbc.annotation.Attribute;
import org.unidal.dal.jdbc.annotation.Entity;
import org.unidal.dal.jdbc.annotation.Variable;

@Entity(logicalName = "overload", physicalName = "overload", alias = "ot")
public class OverloadEntity
{
  @Attribute(field = "id", nullable = false, primaryKey = true, autoIncrement = true)
/* 16 */   public static final DataField ID = new DataField("id");

  @Attribute(field = "report_id", nullable = false)
/* 19 */   public static final DataField REPORT_ID = new DataField("report-id");

  @Attribute(field = "report_type", nullable = false)
/* 22 */   public static final DataField REPORT_TYPE = new DataField("report-type");

  @Attribute(field = "report_size", nullable = false)
/* 25 */   public static final DataField REPORT_SIZE = new DataField("report-size");

  @Attribute(field = "period", nullable = false)
/* 28 */   public static final DataField PERIOD = new DataField("period");

  @Attribute(field = "creation_date", nullable = false, insertExpr = "NOW()")
/* 31 */   public static final DataField CREATION_DATE = new DataField("creation-date");

  @Attribute(field = "", nullable = false, selectExpr = "max(report_id)")
/* 34 */   public static final DataField MAX_ID = new DataField("max-id");

  @Attribute(field = "", nullable = false, selectExpr = "count(*)")
/* 37 */   public static final DataField COUNT = new DataField("count");

  @Variable
/* 40 */   public static final DataField KEY_ID = new DataField("key-id");

  @Variable
/* 43 */   public static final DataField START_TIME = new DataField("start-time");

  @Variable
/* 46 */   public static final DataField END_TIME = new DataField("end-time");

  @Variable
/* 49 */   public static final DataField TYPE = new DataField("type");

/* 51 */   public static final Readset<Overload> READSET_FULL = new Readset(new DataField[] { ID, REPORT_ID, REPORT_TYPE, REPORT_SIZE, PERIOD, CREATION_DATE });

/* 53 */   public static final Readset<Overload> READSET_MAXID = new Readset(new DataField[] { MAX_ID });

/* 55 */   public static final Readset<Overload> READSET_COUNT_NUM = new Readset(new DataField[] { COUNT });

/* 57 */   public static final Readset<Overload> READSET_ID_SIZE_TYPE = new Readset(new DataField[] { REPORT_ID, REPORT_SIZE, REPORT_TYPE });

/* 59 */   public static final Updateset<Overload> UPDATESET_FULL = new Updateset(new DataField[] { ID, REPORT_ID, REPORT_TYPE, REPORT_SIZE, PERIOD });

/* 61 */   public static final QueryDef FIND_BY_PK = new QueryDef("findByPK", OverloadEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='id'/> = ${key-id}");


/* 64 */   public static final QueryDef INSERT = new QueryDef("insert", OverloadEntity.class, QueryType.INSERT, "INSERT INTO <TABLE/>(<FIELDS/>) VALUES(<VALUES/>)");


/* 67 */   public static final QueryDef UPDATE_BY_PK = new QueryDef("updateByPK", OverloadEntity.class, QueryType.UPDATE, "UPDATE <TABLE/> SET <FIELDS/> WHERE <FIELD name='id'/> = ${key-id}");


/* 70 */   public static final QueryDef DELETE_BY_PK = new QueryDef("deleteByPK", OverloadEntity.class, QueryType.DELETE, "DELETE FROM <TABLE/> WHERE <FIELD name='id'/> = ${key-id}");


/* 73 */   public static final QueryDef FIND_MAX_ID_BY_TYPE = new QueryDef("findMaxIdByType", OverloadEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='report-type'/> = ${type}");


/* 76 */   public static final QueryDef FIND_COUNT = new QueryDef("findCount", OverloadEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/>");


/* 79 */   public static final QueryDef FIND_ID_AND_SIZE_BY_DURATION = new QueryDef("findIdAndSizeByDuration", OverloadEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='period'/> >= ${start-time} AND <FIELD name='period'/> <= ${end-time} ORDER BY <FIELD name='period'/> DESC, <FIELD name='report-type'/> ASC");
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/dal/report/OverloadEntity.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */